function initMenu(){}

function initSlider(){
	var levBtn = $$('.levBtn');
	if(levBtn.length){
		var content = $('content');
		var lev = $('lev');
		lev.fx = new Fx.Tween(lev, {
			property: 'marginLeft'
		});
		content.fx1 = new Fx.Tween(content, {
			property: 'marginLeft'
		});
		levBtn[0].addEvent('click', function(e){
			if(e) e.stop();
			if(!this.getParent().hasClass('open')){
				this.getParent().removeClass('close').addClass('open');
				lev.fx.start(-220);
				content.fx1.start(25);
				this.getElement('img').set('src', this.getElement('img').get('src').replace('arrow_01', 'arrow_02'));
			}
			else{
				this.getParent().removeClass('open').addClass('close');
				lev.fx.start(0);
				content.fx1.start(250);
				this.getElement('img').set('src', this.getElement('img').get('src').replace('arrow_02', 'arrow_01'));
			}
		});	
		levBtn[0].fireEvent('click');
		var contextual = $('contextual');
		contextual.fx = new Fx.Tween(contextual, {
			property: 'marginRight'
		});
		content.fx2 = new Fx.Tween(content, {
			property: 'marginRight'
		});
		levBtn[1].addEvent('click', function(e){
			if(e) e.stop();
			if(!this.getParent().hasClass('open')){
				this.getParent().removeClass('close').addClass('open');
				contextual.fx.start(-220);
				content.fx2.start(15);
				//this.getElement('img').set('src', this.getElement('img').get('src').replace('arrow_02', 'arrow_01'));
			}
			else{
				this.getParent().removeClass('open').addClass('close');
				contextual.fx.start(0);
				content.fx2.start(250);
				//this.getElement('img').set('src', this.getElement('img').get('src').replace('arrow_01', 'arrow_02'));
			}
		});
		levBtn[1].fireEvent('click');
	}
}

window.addEvent('domready', function(){
	initMenu();
	initSlider();
});

function openWin(pageUrl, namewindow, w, h) {
	var width = w;    
	var height = h;  
	var detailwindow = '';
	
	top_val = (screen.height - height)/2 - 30;  
	if (top_val < 0) { top_val = 0; }    
	left_val = (screen.width - width)/2;    
	detailwindow = "toolbar=0, location=0, status=1, menubar=0, resize=No, scrollbars=1, resizable=0, width=" + width + ", height=" + height + ", top=" + top_val + ", left=" + left_val;
	
	window.open(pageUrl, '', detailwindow);
}

(function($) {
	$(document).ready(function(e) {
		$('select[name=theme]').change(function(){
			var valTheme = $(this).val();
			var urlAjax = base_url+'/config-modules/act/list/typeid/2/ajax/true/theme/'+valTheme;
			$.ajax({
				url:urlAjax,
				type:"GET",
				data:"",
				dataType:"html",
				success: function(data){
					if(typeof data != ""){
						$('select[name=layout]').html(data);	
					}
				}	
			});       
    	});
	});
})(jQuery);